package com.bridgeintelligent.tag.scene.mapper;

import com.bridgeintelligent.tag.scene.api.entity.SceneCatalog;
import com.bridgeintelligent.tag.scene.api.vo.SceneCatalogVO;
import com.bridgeintelligent.tag.scene.api.vo.SceneVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @description
 * @author: grp 2021-01-10 19:56
 **/
@Mapper
public interface SceneCatalogMapper {

    List<SceneCatalog> findCatalogList();

    List<SceneCatalogVO> findCatalogVOs();

    int findCatalogNameIsExits(String name, String parentId);

    int findParent(String id);

    Integer findMaxNumber(String parentId);

    int add(String id, String name, String parentId, int number, int level);

    SceneCatalog findById(String id);

    SceneCatalog findByNumber(String parentId, Integer number);

    int update(SceneCatalog neighbor);

    int del(String id);

    List<SceneCatalog> findNext(String id);

    List<String> inCatalogList(String sceneName);

    List<SceneCatalog> findParents();

    List<SceneVO> findSceneByCatalog(String id);

    List<SceneVO> top(@Param("catalogList") List<SceneCatalog> catalogList,@Param("type")String type);

    List<SceneVO> subScene(@Param("catalogList") List<SceneCatalog> catalogList);

    @Select("select count(id) from TAG_ANALYSIS_EXPLORE where id = #{id}")
    int findExploreById(String id);
}
